package com.itheima.reggie.controller;

import com.itheima.reggie.common.ResultInfo;
import com.itheima.reggie.domain.Category;
import com.itheima.reggie.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Slf4j
public class CategoryController {
	@Autowired
	private CategoryService categoryService;

	//根据类型查询分类列表
	@GetMapping("/category/list")
	public ResultInfo findList(){
		List<Category> categoryList = categoryService.findAll();
		return ResultInfo.success(categoryList);
	}
}
